import request from '@/config/axios'
import {
  agentWithdrawalBillParams,
  memberCardBillParams,
  memberFeeBillParams,
  subsidyAmtBillParams,
  merchantAmtBillParams,
  commissionBillParams
} from './types'

// 经纪人提现审核列表
export const agentWithdrawalBillPageApi = (params: agentWithdrawalBillParams) => {
  return request.get({ url: '/agentWithdrawalBill/page', params })
}

// 获取累计申请金额，累计已提现金额
export const getAgentWithdrawalAmtApi = (params: agentWithdrawalBillParams) => {
  return request.get({ url: '/agentWithdrawalBill/getWithdrawalAmt', params })
}

// 经纪人提现审核
export const agentWithdrawalBillAuditApi = (data: agentWithdrawalBillParams) => {
  return request.post({ url: '/agentWithdrawalBill/audit', data })
}

// 商户本金提现审核列表
export const merchantAmtWithdrawalBillPageApi = (params: agentWithdrawalBillParams) => {
  return request.get({ url: '/merchantAmtWithdrawalBill/page', params })
}

// 获取累计申请金额，累计已提现金额
export const getMerchantAmtWithdrawalAmtApi = (params: agentWithdrawalBillParams) => {
  return request.get({ url: '/merchantAmtWithdrawalBill/getWithdrawalAmt', params })
}

// 商户本金提现审核
export const merchantAmtWithdrawalBillAuditApi = (data: agentWithdrawalBillParams) => {
  return request.post({ url: '/merchantAmtWithdrawalBill/audit', data })
}

// 商户补贴提现审核列表
export const merchantSubsidyWithdrawalBillPageApi = (params: agentWithdrawalBillParams) => {
  return request.get({ url: '/merchantSubsidyWithdrawalBill/page', params })
}

// 获取累计申请金额，累计已提现金额
export const getMerchantSubsidyWithdrawalAmtApi = (params: agentWithdrawalBillParams) => {
  return request.get({ url: '/merchantSubsidyWithdrawalBill/getWithdrawalAmt', params })
}

// 商户补贴提现审核
export const merchantSubsidyWithdrawalBillAuditApi = (data: agentWithdrawalBillParams) => {
  return request.post({ url: '/merchantSubsidyWithdrawalBill/audit', data })
}

// 次卡购买记录列表
export const getMemberCardBillListApi = (params: memberCardBillParams) => {
  return request.get({ url: '/memberCardBill/page', params })
}

// 查询累计成交金额
export const getCardTotalAmtApi = () => {
  return request.get({ url: '/memberCardBill/getTotalAmt' })
}

// 会员续费记录列表
export const getMemberFeeBillListApi = (params: memberFeeBillParams) => {
  return request.get({ url: '/memberFeeBill/page', params })
}

// 查询累计成交金额
export const getFeeTotalAmtApi = () => {
  return request.get({ url: '/memberFeeBill/getTotalAmt' })
}

// 商家补贴账户明细
export const getSubsidyAmtBillListApi = (params: subsidyAmtBillParams) => {
  return request.get({ url: '/subsidyAmtBill/page', params })
}

// 商户资金流水
export const getMerchantAmtBillListApi = (params: merchantAmtBillParams) => {
  return request.get({ url: '/merchantAmtBill/page', params })
}

// 佣金资金流水
export const getCommissionBillListApi = (params: commissionBillParams) => {
  return request.get({ url: '/commissionBill/page', params })
}

// 结算池商家补贴充值管理列表
export const businessRechargeApplyPageApi = (params) => {
  return request.get({ url: '/businessRechargeApply/page', params })
}

// 结算池商家补贴充值管理审核
export const businessRechargeApplyAuditApi = (data) => {
  return request.post({ url: '/businessRechargeApply/audit', data })
}

// 核算信息
export const infoApi = (params) => {
  return request.get({ url: '/withdrawalBill/check/info', params })
}

// 核算初始化
export const initApi = (params) => {
  return request.get({ url: '/withdrawalBill/check/init', params })
}

// 核算预览
export const preApi = (params) => {
  return request.get({ url: '/withdrawalBill/check/pre', params })
}

// 保存
export const saveApi = (data) => {
  return request.post({ url: '/withdrawalBill/check/save', data })
}

// 下载订单明细
export const exportOrderExcelApi = (params) => {
  return request.get({ url: '/withdrawalBill/exportOrderExcel', params, responseType: 'blob' })
}

// 获取打款凭证
export const getPaymentVoucherApi = (params) => {
  return request.get({ url: '/withdrawalBill/settlementPool/getPaymentVoucher', params })
}

// 打款（上传打款凭证）
export const uploadPaymentVoucherApi = (data) => {
  return request.post({ url: '/withdrawalBill/settlementPool/uploadPaymentVoucher', data })
}

// 结算池商户本金提现审核列表
export const amtPageApi = (params) => {
  return request.get({ url: '/withdrawalBill/settlementPool/amtPage', params })
}

// (结算池商户本金)获取累计申请金额，累计已提现金额
export const getAmtApi = () => {
  return request.get({ url: '/withdrawalBill/settlementPool/getAmt' })
}

// 结算池商户补贴提现审核列表
export const subsidyPageApi = (params) => {
  return request.get({ url: '/withdrawalBill/settlementPool/subsidyPage', params })
}

// (结算池商户补贴)获取累计申请金额，累计已提现金额
export const getSubsidyAmtApi = () => {
  return request.get({ url: '/withdrawalBill/settlementPool/getSubsidyAmt' })
}
